package com.jcli.jb51_net.article._271803_Pong.com.mr.service;

import com.jcli.jb51_net.article._271803_Pong.com.mr.view.GamePanel;

/**
 * TODO 刷新帧
 *
 * @author li
 * @version 1.0
 * @belongsProject novel_20230923
 * @belongsPackage com.jcli.jb51_net.article._271803_Pong.com.mr.service
 * @className Fresh
 * @createTime 2024-02-24  08:37
 */
public class Fresh extends Thread {
    public final int INTERVAL = 20;
    private GamePanel panel;

    public Fresh(GamePanel gamePanel) {
        this.panel = gamePanel;
    }

    public void run() {
        while (true) {
            panel.repaint();
            try {
                Thread.sleep(INTERVAL);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
